package algorithm_demo.leetcode;

/**
 * 105. 从前序与中序遍历序列构造二叉树
 * <a href="https://leetcode.cn/problems/construct-binary-tree-from-preorder-and-inorder-traversal/">https://leetcode.cn/problems/construct-binary-tree-from-preorder-and-inorder-traversal/</a>
 * @author Api
 * @date 2023/5/1 11:37
 */
public class Problem_105_ConstructBinaryTreeFromPreorderAndInorderTraversal {
    /*
    * 二叉树的先序、中序、后序遍历
    * 1.先序：任何子树的处理顺序都是，先头节点、再左子树、然后右子树
    * 2.中序：任何子树的处理顺序都是，先左子树、再头节点、然后右子树
    * 3.任何子树的处理顺序都是，先左子树、再右子树、然后头节点
    * */

    public static class TreeNode {
        int val;
        TreeNode left;
        TreeNode right;
        TreeNode() {}
        TreeNode(int val) { this.val = val; }
        TreeNode(int val, TreeNode left, TreeNode right) {
            this.val = val;
            this.left = left;
            this.right = right;
        }
    }
    public TreeNode buildTree(int[] pre, int[] in) {
        return null;
    }

}
